An E cient Algorithm for Computing MHP Information for Concurrent Java Programs
نویسندگان
چکیده
Information about which statements in a concurrent program may happen in parallel MHP has a number of important applications It can be used in program optimization debugging program understanding tools improving the accuracy of data ow approaches e g and detecting synchronization anomalies such as data races For example in optimization if it is known that two threads of control will never attempt to enter a critical region of code at the same time any unnecessary locking operations can be removed In general the problem of precisely computing all pairs of statements that may execute in parallel is undecidable If we assume that all control paths in all threads of control are executable then the problem is NP complete In this paper we call the solution with this assumption the ideal MHP information for a program To compute the MHP information e ciently a trade o must be made where instead of the ideal information a conservative estimate of all MHP pairs is computed In this context a conservative set contains all the pairs that can actually execute in parallel but may also contain spurious pairs The precision of such approaches can be measured by comparing the set of pairs computed by an approach with the ideal set if the latter is known In this paper we propose a data ow algorithm for computing a conservative estimate of the MHP information for Java programs with a worst case time bound that is cubic in the size of the program In the rest of this paper we refer to this algorithm as the MHP algorithm To evaluate the practical precision of our algorithm we have carried out a preliminary experimental comparison of our algorithm and a reachability analysis that determines the ideal MHP information for concurrent Java programs This initial experiment indicates that our algorithm precisely computed the ideal MHP information in the vast majority of cases we examined In the two out of cases where the MHP algorithm turned out to be less than ideally precise the number of spurious pairs was small compared to the total number of ideal MHP pairs Several approaches for computing the MHP information for programs using various synchronization mechanisms have been proposed Callahan and Subhlok proposed a data ow algorithm that computes for each statement in a concurrent program with post wait synchronization the set of statements that must be executed before this statement can be executed B analysis Duesterwald and So a applied this approach to the Ada rendezvous model and extended B analysis to be interprocedural Masticola and Ryder proposed an iterative approach of non concurrency analysis that computes a conservative estimate of the set of pairs of communication statements that can never happen in parallel in a concurrent Ada program
منابع مشابه
An Efficient Algorithm for Computing MHP Information for Concurrent Java Programs
Information about which statements in a concurrent program may happen in parallel (MHP) has a number of important applications. It can be used in program optimization, debugging, program understanding tools, improving the accuracy of data flow approaches, and detecting synchronization anomalies, such as data races. In this paper we propose a data flow algorithm for computing a conservative esti...
متن کاملA Practical MHP Information Analysis for Concurrent Java Programs
In this paper we present an implementation of May Happen in Parallel analysis for Java that attempts to address some of the practical implementation concerns of the original work. We describe a design that incorporates techniques for aiding a feasible implementation and expanding the range of acceptable inputs. We provide experimental results showing the utility and impact of our approach and o...
متن کاملDetecting Concurrently Executed Paris of Statements Using Adapted MHP Algorithm
Information about which pairs of statements in a concurrent program can be executed concurrently is important for improving the accuracy of dataflow analysis, optimizing programs, and detecting errors. This paper presents a new method named Concurrent Control Flow Graph for representing concurrent Ada programs in a simple and precise way. Based on this method, we develop an Adapted MHP (May Hap...
متن کاملMay-Happen-in-Parallel Analysis with Returned Futures
May-Happen-in-Parallel (MHP) is a fundamental analysis to reason about concurrent programs. It infers the pairs of program points that may execute in parallel, or interleave their execution. This information is essential to prove, among other things, absence of data races, deadlock freeness, termination, and resource usage. This paper presents an MHP analysis for asynchronous programs that use ...
متن کاملSlicing Concurrent Java Programs
Although many slicing algorithms have been proposed for object-oriented programs, no slicing algorithm has been proposed which can be used to handle the problem of slicing concurrent Java programs correctly. In this paper, we propose a slicing algorithm for concurrent Java programs. To slice concurrent Java programs, we present a dependence-based representation called multithreaded dependence g...
متن کامل